<div class="wrapper-md" ng-controller="dept">
    <toaster-container toaster-options="{'position-class': 'toast-top-center', 'close-button':true}"></toaster-container>
    <div ng-if="deptList" class="panel panel-default">
        <div class="panel-heading">
            {{title.title}}
            <button ng-click="jumpToUrl()" style="float: right;margin-top: -5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>新建
            </button>
        </div>
        <div class="hbox hbox-auto-xs hbox-auto-sm">
            <div class="col" style="width:20%">
                <div class="wrapper-md">
                    <div class="b-a bg-light dk r r-2x">
                        <span ng-if="doing_async">...loading...</span>
                        <div style="width:100%;height:462px;overflow-y:scroll;overflow-x:auto;" class="zTreeDemoBackground left">
                            <ul id="mytree" class="ztree"></ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel-body b-b b-light">
                搜索: <input id="filter" type="text" class="form-control input-sm w-sm inline m-r"/>
            </div>
            <div>
                <table class="table m-b-none" ui-jq="footable" data-filter="#filter" data-page-size="10">
                    <thead>
                    <tr>
                        <th data-toggle="true">{{columns[0].title}}</th>
                        <th>{{columns[1].title}}</th>
                        <th>{{columns[2].title}}</th>
                        <th>{{columns[3].title}}</th>
                        <th>{{columns[4].title}}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-if="saveDate.length<=0">
                        <td>没有数据！</td>
                    </tr>
                    <tr ng-repeat="tb in saveDate">
                        <td>{{tb.deptNumber}}</td>
                        <td><a href ng-click="showInfo(tb)">{{tb.deptName}}</a></td>
                        <td>{{tb.topName}}</td>
                        <td>{{tb.createTime}}</td>
                        <td data-value="1"><span class="{{tb.status1}}" title="Active">{{tb.status}}</span></td>
                    </tr>
                    </tbody>
                    <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="5" class="text-center">
                            <ul class="pagination"></ul>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
    <div ng-if="deptAdd" class="panel panel-default">
        <div class="panel-heading">
            <u style="cursor:pointer"  ng-click="jumpToUrl()">{{title.title}}</u> / {{title.addTitle}}
            <button ng-click="saveInfo('sm')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>保存
            </button>
            <button ng-click="jumpToUrl()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-hand-o-left"></i>返回
            </button>
        </div>
        <div class="panel-body">
            <form class="form-horizontal" method="get">
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="input-id-2"><span style="color:red">*</span>部门编号</label>
                    <div class="col-sm-5">
                        <input disabled type="text" class="form-control" id="deptNumber" value="{{deptRow.deptNumber}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="input-id-1"><span style="color:red">*</span>部门名称</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" id="deptName" value="{{deptRow.deptName}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="input-id-3">上级部门</label>
                    <div class="col-sm-5">
                        <input style="width:85%;float: left" type="text" class="form-control" id="topName" value="{{deptRow.topName}}">
                        <input style="display:none" type="text" class="form-control" id="topId" value="{{deptRow.topId}}">
                        <span class="input-group-btn">
                            <button ng-click="showSelectDept('topName')" class="btn btn-default" type="button"><i class="fa fa-plus"></i></button>
                        </span>
                    </div>
                </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                    <label class="col-sm-3 control-label" for="input-id-4">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" id="bz" value="{{deptRow.deptContent}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">是否启用</label>
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox" ng-checked="{{deptRow.qy}}" id="qy">
                        <i></i>
                    </label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </form>
        </div>
    </div>
</div>
<script type="text/ng-template" id="myModalContent.html">
    <div ng-include="'tpl/modal.html'"></div>
</script>
<script type="text/ng-template" id="selectDept.html">
    <div ng-include="'tpl/selectDept.html'"></div>
</script>